<?php
namespace app\admin\controller;

use app\common\builder\ZBuilder;
use app\admin\model\Wxapplog as WxapplogModel;
use think\Image;
use think\File;
use think\facade\Hook;
use think\Db;
use think\facade\Env;

class Statistics extends Admin
{
    public function index()
    {
         // 查询
         $map = $this->getMap();
         // 数据列表
         $wxapplogModel = new WxapplogModel();
         $data_list = $wxapplogModel->getList($map);
         return ZBuilder::make('table')
         ->setSearch(['q.title' => '标题','w.title' => '所属小程序']) // 设置搜索框
         ->setPageTitle('用户列表')
         ->addColumns([ // 批量添加数据列
             ['id', 'ID'],
             ['wtitle', '所属小程序'],
             ['today_login', '今日登录'],
             ['total_login', '累计登录'],
             ['total_user', '总注册用户'],
             // ['status', '状态', 'switch'],
            //  ['right_button', '操作', 'btn']
         ])
         ->addTopButtons('enable,disable') // 批量添加顶部按钮
         ->addRightButtons('delete') // 批量添加右侧按钮
         ->setRowList($data_list) // 设置表格数据
         ->fetch(); // 渲染模板
    }
}